package cn.fay.chapter05;

public class Book {

	private boolean checkedOut=false;
	Book(boolean checkOut)
	{
		checkedOut=checkOut;
	}
	void checkIn()
	{
		checkedOut=false;
	}
	@Override
	protected void finalize()
	{
		if (checkedOut) {
			System.out.println("Error:checked out");
		}
		try {
			super.finalize();
		} catch (Throwable e) {
			throw new RuntimeException(e);
		}
	}
}
